<?php
header("Content-Type: text/html; charset=utf-8");
$tm = $_GET['tm'];
$da = json_decode($tm,true);
$name = $_GET['name'];
$tx = $_GET['tx'];
$data=array('df'=>'fwbjx','ztpj'=>null);
$df=0;
switch ($da[0]){
	case B:  $df=$df+10 ;break;
}
switch ($da[1]){
	case C:  $df=$df+10 ;break;
}
switch ($da[2]){
	case C:  $df=$df+10 ;break;
}
switch ($da[3]){
	case A:  $df=$df+10 ;break;
}
switch ($da[4]){
	case D:  $df=$df+10 ;break;
}
switch ($da[5]){
	case C:  $df=$df+10 ;break;
}
switch ($da[6]){
	case D:  $df=$df+10 ;break;
}
switch ($da[7]){
	case C:  $df=$df+10 ;break;
}
switch ($da[8]){
	case C:  $df=$df+10 ;break;
}
switch ($da[9]){
	case D:  $df=$df+10 ;break;
}

if($df==100){
	$character="哇,你一定就是传说中千年难遇的土味情话精转世吧。快趁着这个七夕,为你的爱情定制专属的土味情话吧。这波狗粮我先干为敬!";
	$work="土味情话之王";
}elseif ($df>=70) {
	$character="你在说土味情话方面极具潜力,这既离不开你的先天天赋,更离不开你的后天努力,土味不是一天练成的,期待你修炼成土味情话之王的那天。";
	$work="土味情话达人";
}elseif($df>=40){
	$character="恭喜你,你的土味情话能力,勉强达到参赛水平了,不过你的进步空间还很大。相信经过1年的练习你可以顺利出道啦,要成为土味情话之王还是土味情话达人,接下来,就看你的了";
	$work="土味情话新手";
}else{
	$character="天啦,从未见过土味情话技能如此烂的人。你的对象说你无趣,不要怀疑,你真真真真真的很无趣。建议你从现在开始,跟着土味小编,学习土味情话,明年七夕,你一定就是土味情话之王,相信你喲(^^)ノ~Y";
	$work="情话终结者";
}

$data[ztpj]=[
   ['display: flex;  width:100%; flex-direction: column; align-items: center; text-align: center; justify-content: center;',
     array( type=> 'text', text=> $name."的土味情话测试报告", style=> 'margin:10rpx 0 20rpx 0; font-size: 45rpx; color: black; justify-content: center; width:100%; text-align: center;'),//测试标题
    ],
    ['display: flex; width:96%; margin: 15rpx; flex-direction: column;',
       array( type=> 'text', text=> '我的土味情话测试得分：'.$df, style=> 'font-size: 32rpx; color: black; margin: 10rpx;'),
   ],
   ['margin:15rpx; width:96%; height:35rpx; background:rgb(230,230,230); border-radius: 20rpx;',
   	['display:flex; height: 100%; width: '.$df.'%; background: green; border-radius: 20rpx; text-align: center; justify-content: center;']
    ],
   ['display: flex; width:96%; margin: 15rpx; flex-direction: column;',
       array( type=> 'text', text=> '我的土味情话级别', style=> 'font-size: 35rpx; color: #39b54a; margin: 10rpx;'),
       array( type=> 'text', text=> $work, style=> 'font-size: 35rpx; color: black; margin: 15rpx;'),
   ],
   ['display: flex; width:96%; margin: 15rpx; flex-direction: column;',
       array( type=> 'text', text=> '土味情话级别简介', style=> 'font-size: 35rpx; color: #39b54a; margin: 10rpx;'),
       array( type=> 'text', text=> $character, style=> 'font-size: 30rpx; color: black; margin: 15rpx;'),
   ],
   ['display: flex;',
	   array( type=> 'button', text=> '分享给好友',style=> 'width:50%; margin:30rpx 5rpx 30rpx 15rpx; color: #ffffff; background: #0081ff;',opentype=> 'share', 'class'=> 'cu-btn'),
	   array( type=> 'button', text=> '加入交流群',style=> 'width:50%; margin:30rpx 15rpx 30rpx 5rpx; color: #ffffff; background: #39b54a;',opentype=> 'openGroupProfile', 'class'=> 'cu-btn'),
	]
];
echo json_encode($data,JSON_UNESCAPED_UNICODE);
?>